﻿using System;

namespace 设计模式01
{
    class Program
    {
        static void Main(string[] args)
        {
            // 单例模式
            //var s = Singleton.GetInstance();

            // 抽象工厂
            //AbstractFactory f = new ShangHaiFactory();
            //f.CreateYaBo().Print();
            //f.CreateYaJia().Print();

            // 建造者模式
            //Director d = new Director();
            //Builder b1 = new ConcreteBuilder1();
            //Builder b2 = new ConcreteBuilder2();

            //d.Construct(b1);
            //d.Construct(b2);
            //Computer c1 = b1.GetComputer();
            //Computer c2 = b2.GetComputer();

            //c1.Show();
            //c2.Show();

            // 原型模式
            MonkeyKingPrototype prototype = new ConcretePrototype("MonkeyKing");
            MonkeyKingPrototype clone = prototype.Clone() as ConcretePrototype;
            Console.WriteLine(clone.Id);


            //Console.WriteLine("完成");
            Console.ReadKey();



        }
    }

}